﻿using System;
using System.IO;
namespace SkeinLib
{
    public static class SkeinDebug
    {
        const string BASEWORKINGDIR = @"C:\DOTNET Programs\Skein\DebugFiles\";

        public static void WriteData2File(ref UInt64[] data, string fileName, string testName, string description)
        {
            string extendedFileName = BASEWORKINGDIR + fileName + ".txt"; //+ DateTime.Now.ToString("yyyyMMddHHmmss.fffffff");
            
            StreamWriter theFile;
            if(File.Exists(extendedFileName))
                theFile= System.IO.File.AppendText(extendedFileName);
            else
                theFile= System.IO.File.CreateText(extendedFileName);
            theFile.WriteLine(testName);
            theFile.WriteLine(description);
            theFile.WriteLine("DATE/TIME: " + DateTime.Now.ToString("F"));
            for (int i = 0; i < data.Length; i++)
            {
                theFile.WriteLine("i=" + i.ToString("00") + " data=0x" + data[i].ToString("X16") + "  ");
            }
            theFile.WriteLine(" - - - - - - - - - - - - - - - - ");
            theFile.Close();
        }
    }
}